package config;

import com.jfinal.config.*;
import com.jfinal.core.JFinal;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.c3p0.C3p0Plugin;
import com.jfinal.plugin.druid.DruidPlugin;

import controll.BlogController;
import controll.Index;
import controll.RegistController;
import controll.UploadController;


public class DemoConfig extends JFinalConfig {
	public void configConstant(Constants me) {
		me.setDevMode(true);
	}

	public void configRoute(Routes me) {
//		me.add("/", Index.class, "/index");	// 第三个参数为该Controller的视图存放路径
//		me.add("/regist", RegistController.class, "/index");
//		me.add("/blog", BlogController.class, "/index");
//		me.add("/upload", UploadController.class, "/index");
	}

	public void configPlugin(Plugins me) {
//		DruidPlugin cp = new DruidPlugin("jdbc:mysql://19mm.com:3306/carblog?characterEncoding=UTF-8", "root", "guavaguava00");
//		me.add(cp);
//		ActiveRecordPlugin arp = new ActiveRecordPlugin(cp); 
//		me.add(arp);
//		arp.addMapping("t_person", PersonM.class); 
//		arp.addMapping("t_user", User.class); 
//		arp.addMapping("t_blogpages", Blogpage.class); 
	}

	public void configInterceptor(Interceptors me) {
	}

	public void configHandler(Handlers me) {
	}

	public static void main(String[] args) {
		JFinal.start("WebRoot", 8080, "/", 5);
	}
}